
import {setServer} from "@/utils/axios";
import {toolUrl} from "../../../url";
const toolRequest = setServer(toolUrl);
const request = setServer('');

// 查询小区
export function getBiotope(query) {
  return request({
    url: '/biotope/list',
    method: 'get',
    params: query
  })
}

// 查询所有小区
export function getAllBiotope(query) {
  return request({
    url: '/biotope/refer',
    method: 'get',
    params: query
  })
}

// 查询所有小区
export function getBiotopeByName(query) {
  return request({
    url: '/biotope/list-name',
    method: 'get',
    params: query
  })
}

// 查询设备小区下拉
export function getBiotopeSelect(query) {
  return request({
    url: '/biotope/list-select',
    method: 'get',
    params: query
  })
}

// 查询小区详情
export function getBiotopeDetail(id) {
  return request({
    url: '/biotope/'+id,
    method: 'get',
  })
}

// 修改小区
export function updateBiotope(query) {
  return request({
    url: '/biotope/',
    method: 'put',
    data: query
  })
}

// 新增小区
export function addBiotope(query) {
  return request({
    url: '/biotope/',
    method: 'post',
    data: query
  })
}

// 删除小区
export function deleteBiotope(id) {
  return request({
    url: '/biotope/'+id,
    method: 'delete',
  })
}

// 设置小区设备位置
export function setBiotopeMap(query) {
  return request({
    url: '/biotope/set-map',
    method: 'put',
    params: query
  })
}

// 获取地图小区
export function getMapBiotope(query){
  return request({
    url: '/biotope/refer/location',
    method: 'get',
    params: query
  })
}

// 获取小区保活数据
export function getBiotopeKeepAlive(query){
  return request({
    url: '/biotope/keep-alive',
    method: 'get',
    params: query
  })
}

// 获取踩点工具小区
export function getToolBiotope(query){
  return toolRequest({
    url: '/biotope/list-keyword',
    method: 'get',
    params: query
  })
}

// 设置小区必填凭证人员类型
export function setRequireRemard(query) {
  return request({
    url: '/biotope/require-remard',
    method: 'post',
    params: query
  })
}

// 查询小区上报数据
export function getBiotopeUpload(query) {
  return request({
    url: '/biotope/upload-list',
    method: 'get',
    params: query
  })
}

// 查询小区上报数据详情
export function getBiotopeUploadDetail(query) {
  return request({
    url: '/biotope/upload-detail',
    method: 'get',
    params: query
  })
}
